package IT07;
/*
用泛型来输出复杂类型值
 */
public class GenericDemo {
    public static void main(String[] args) {
        Generic<String> gs = new Generic<String>();
        gs.setT("29");
        Generic<Boolean> gb = new Generic<>();
        gb.setT(true);
        Generic<Integer> gi = new Generic<>();
        gi.setT(20);
        System.out.println(gs.getT());
        System.out.println(gb.getT());
        System.out.println(gi.getT());
        System.out.println("------------");
        //用泛型方法改进
        Generic02 g = new Generic02();
        g.show(20);
        g.show("wang");
        g.show(true);
        System.out.println("------------");
        //用接口方法改进
        Generic03<String> gss = new GenericImpl<>();
        gss.show("王祖贤");
    }
}
